package com.atguigu.spzx.user.controller;

import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.atguigu.spzx.user.service.SmsService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: SmsController
 * Package: com.atguigu.spzx.user.controller
 * Description:
 *
 * @Author 刘强
 * @Create 2024/7/16 2:53
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/user/sms")
public class SmsController {
    @Resource
    private SmsService smsService;

    /**
     * 发送验证码
     * @param phone
     * @return
     */
    @GetMapping("sendCode/{phone}")
    public Result sendValidateCode(@PathVariable String phone) {
        smsService.sendValidateCode(phone);
        return Result.build(null, ResultCodeEnum.SUCCESS);
    }
}
